<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@page import="java.text.SimpleDateFormat"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt_rt"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="Author" content="Fly">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <link rel = "stylesheet" href = "<%=basePath %>css/shou-011.css">
    <title>Title</title>
    <style>

    </style>
    <script type="text/javascript" src="<%=basePath %>js/jquery-1.10.1.js"></script>
    <script type="text/javascript" src="<%=basePath %>js/shou.js"></script>
<script type="text/javascript" src="<%=basePath %>js/fenye.js"></script>
  
    <script type="text/javascript">		
    function putOn(){
	//检查表单是否都通过验证
		var interviewer=$("#select").val();
		location.href="/kss/staff/findAllStaff.do?interviewer="+interviewer+"&staff_name=null";
}
function putOn1(){
	//检查表单是否都通过验证
		var name=$("#STAFFNAME").val();
		location.href="/kss/staff/findAllStaff.do?staff_name="+name+"&interviewer=ALL";
}	

function putOn2(id){
			$.ajax({
			"url":"/kss/staff/findOneStaffById.do",
			"type":"post",
			"data":{"staff_id":id},
			"dataType":"json",
			"success":function(data){
				$("#staffName2").text(data.staffName);
				if(data.staffState==1){
					$("#staffState2").text("正常");
				}else{
					$("#staffState2").text("淘汰");
				}
				$("#interviewer2").text(data.interviewer);
				$("#emial2").text(data.emial);
				$("#nativteplace2").text(data.nativteplace);
				$("#professional2").text(data.professional);
				$("#tel2").text(data.tel);
				$("#entry2").text(data.entryTime);
				if(data.staffSex==1){
					$("#staffSex2").text("男");
				}else{
					$("#staffSex2").text("女");
				}
				
				$("#direction2").text(data.direction);
				$("#interDept2").text(data.interDept);
				$("#birthdate2").text(data.brith);
				$("#degree2").text(data.degree);
				$("#school2").text(data.school);
				$("#graduate2").text(data.graduateTime);		
					
			},
			"error":function(){
				alert("系统繁忙");
			}
		});
		
	 $('.mask_basic_details').css('display','block');
}

function putOn3(id){
			$.ajax({
			"url":"/kss/staff/findOneStaffById.do",
			"type":"post",
			"data":{"staff_id":id},
			"dataType":"json",
			"success":function(data){
				$("#staffId").val(data.staffId);
				$("#staffName").val(data.staffName);
				if(data.staffState==1){
					$("#staffState").val("正常");
				}else{
					$("#staffState").val("淘汰");
				}
				$("#interviewer").val(data.interviewer);
				$("#emial").val(data.emial);
				$("#nativteplace").val(data.nativteplace);
				$("#professional").val(data.professional);
				$("#tel").val(data.tel);
				$("#entry").val(data.entryTime);
				if(data.staffSex==1){
					$("#staffSex").val("男");
				}else{
					$("#staffSex").val("女");
				}
				
				$("#direction").val(data.direction);
				$("#interDept").val(data.interDept);
				$("#birthdate").val(data.brith);
				$("#degree").val(data.degree);
				$("#school").val(data.school);
				$("#graduate").val(data.graduateTime);		
					
			},
			"error":function(){
				alert("系统繁忙");
			}
		});
		
	 $('.mask_basic_edit').css('display','block');
}

function putOn4(){
	$('.mask_basic_edit').css('display','none');
}

function putOn5(){
	 $('.mask_import_1').css('display','block');
}

function putOn6(){
	 $('.mask_import_1').css('display','none');
}
    </script>
    
   
	
</head>
<body>
<div class="mask_import_1">
    <div class="mask_content">
        <p>导入信息</p>
        <form action="/kss/staff/importStaff.do" method="POST" enctype="multipart/form-data">
            <div style="width: 486px;text-align: center">
                <input id="import_1" type = "file" name="testfile">
            </div>
            <div class="button">
                <button class="submit" type="submit">确&nbsp&nbsp认</button>
                <span class="cancel_import_1" onclick="putOn6()">取&nbsp&nbsp消</span>
            </div>
        </form>
    </div>
</div>



<!--基本信息-->
	<div class="mask_basic_details">
    <div class="mask_content">
        <a href = "/kss/staff/findAllStaff.do?interviewer=ALL&staff_name=null"><span class="xx"></span></a>
        <p>查看实习生</p>
        
        <div class="mask_table1" >
        <table id="roles_update">
        		<tr><th>姓名</th><td id="staffName2"></td></tr>
                 <tr><th>目前状态</th><td id="staffState2"></td></tr>
                 <tr><th>面试官</th><td id="interviewer2"></td></tr>
                 <tr><th>内网邮箱</th><td id="emial2"></td></tr>
                 <tr><th>籍贯</th><td id="nativteplace2"></td></tr>
                 <tr><th>专业</th><td id="professional2"></td></tr>
                 <tr><th>联系电话</th><td id="tel2"></td></tr>
                 <tr><th>入司时间</th><td id="entry2"></td></tr>
             </table>
        </div>
        <div class="mask_table2" >
             <table id="roles_update2">
                 <tr><th>性别</th><td id="staffSex2"></td></tr>
                 <tr><th>应聘方向</th><td id="direction2"></td></tr>
                 <tr><th>面试官部门</th><td id="interDept2"></td></tr>
                 <tr><th>出生日期</th><td id="birthdate2"></td></tr>
                 <tr><th>最高学历</th><td id="degree2"></td></tr>
                 <tr><th>毕业学校</th><td id="school2"></td></tr>
                 <tr><th>毕业时间</th><td id="graduate2"></td></tr>
						
             </table>
        </div>
    </div>
</div>

<div class="mask_basic_edit">
    <div class="mask_content">

        <p>编辑实习生</p>
        <form action = "/kss/staff/updateStaff.do" method="post">
            <div class="mask_form1">
               
                <label class="lab1" for="">姓名</label><input id="staffName" name="staffName" type = "text" value="" >
                <label class="lab1"  for="For1">目前状态</label><input id="staffState" name="state" type = "text" value="">
                <label class="lab1"  for="For2">面试官</label><input id="interviewer" name="interviewer" type = "text" value="">
                <label class="lab1"  for="For3">内网邮箱</label><input id="emial" name="emial" type = "text" value="">
                <label class="lab1"  for="For4">籍贯</label><input id="nativteplace" name="nativteplace" type = "text" value="">
                <label class="lab1"  for="For5">专业</label><input id="professional" name="professional" type = "text" value="">
                <label class="lab1"  for="For6">联系电话</label><input id="tel" name="tel" type = "text" value="" maxlength="11">
                <label class="lab1"  for="For7">入司时间</label><input id="entry" name="entry" type = "date" value="">
                	<input  id="staffId" name="staffId" type = "hidden" value="" >
            </div>
            <div class="mask_form2">
                <div><label class="lab1"  for="sex">性别</label><input id="staffSex" name="sex" type = "text" value=""></div>
                <div><label class="lab1"  for="For8">应聘方向</label><input id="direction" name="direction" type = "text" value=""></div>
                <div><label class="lab1"  for="For9">面试官部门</label><input id="interDept" name="interDept" type = "text" value=""></div>
                <div><label class="lab1"  for="For10">出生日期</label><input id="birthdate" name="birthdate" type = "date" value=""></div>
                <div><label class="lab1"  for="For11">最高学历</label><input id="degree" name="degree" type = "text" value=""></div>
                <div><label class="lab1"  for="For12">毕业学校</label><input id="school" name="school" type = "text" value=""></div>
                <div><label class="lab1"  for="For13">毕业时间</label><input id="graduate" name="graduate" type = "date" value=""></div>
                <div><label class="lab1"  for="For14">分配部门</label><select id="dept" name="dept">
                	<option value="通信政法产品事业部">通信政法产品事业部</option>
                	<option value="电子政务产品事业部">电子政务产品事业部</option>
                	<option value="低碳产品事业部">低碳产品事业部</option>
                	<option value="税务产品事业部">税务产品事业部</option>
                	<option value="实施与运维部">实施与运维部</option>
                </select></div>
            </div>
            <div class="button">
                <button class="submit" type="submit">确&nbsp&nbsp认</button>
                <span class="cancel" onclick="putOn4()">取&nbsp&nbsp消</span>
            </div>
        </form>
    </div>
</div>

<div class="head">

</div>
<div class="content">
   <div class="content_left">
        <p class="clp cl1"><a href = "/kss/login/shouye.do">首页</a></p>
        <div class="cld"></div>
        <p class="clp cl2 _clp_  "><a>实习生信息</a></p>
        <div class="cld cl2_1">
            <li class="cl_li1 _cl_li "><a href = "/kss/staff/findAllStaff.do?interviewer=ALL&staff_name=null">基本信息</a></li>
            <li class="cl_li2 "><a href = "/kss/apply/findAllApply.do">请假信息</a></li>
        </div>
        <p class="=clp cl3 "><a>培训信息</a></p>
        <div class="cld cl3_1">

            <li class="cl_li6 " ><a href = "/kss/find/findFirstPhase.do">阶段成绩</a></li>
            <li class="cl_li7 "><a href = "/kss/jieduan/findJieDuan.do">综合查询</a></li>

        </div>
        <p class="clp cl4"><a>特殊人员</a></p>
        <div class="cld cl4_1">
            <li class="cl_li4"><a href = "/kss/eliminate/selEliminate.do">淘汰人员</a></li>
            <li class="cl_li5"><a href = "/kss/newCome/getNew.do">新增人员</a></li>
        </div>
        <p class="clp cl5"><a href = "/kss/staff/echarts.do">综合信息</a></p>
        <div  >

        </div>
    </div>
    </div>


    <!--基本信息-->
    <div class="content_right1">
        <div class="cr1">
            <p>实习生信息-基本信息</p>
            <p>
              
               <label for="select" style="font-size:20px">按面试官查询：</label> 
                <select id="select" onchange="putOn()">
	<option value="ALL" style="font-size: 20px;color:#ccc;">全部</option>
	<c:forEach items="${interviewers}" var="interviewer">
		<c:if test="${interview==interviewer}">
				<option style="color: black" value="${interviewer}" selected="selected">${interviewer}</option>
		</c:if>
		<c:if test="${interview!=interviewer}">
				<option style="color: black" value="${interviewer}" >${interviewer}</option>
		</c:if>
			
           </c:forEach>
</select>
				  <label for="STAFFNAME" style="font-size:20px">&nbsp&nbsp&nbsp按实习生姓名查询：</label> 
				  <c:if test="${staff_name!='null'}">
	<input id="STAFFNAME" type="text" value="${staff_name}" placeholder="请输入实习生姓名">
</c:if>

<c:if test="${staff_name=='null'}">
	<input id="STAFFNAME" type="text" placeholder="请输入实习生姓名"/>
</c:if>
						<span class="cr1_1" onclick="putOn1()"><a href = "#">查询</a></span>
                <span class="cr1_2" onclick="putOn5()"><a href = "#">excel导入</a></span>
                <span class="import" id="import" onclick="putOn5()"><a href="#">导入信息</a><a href="#">导入信息</a></span>
            </p>
            <table id="table1">
                <thead>
                    <th>姓名</th>
                    <th>目前状态</th>
                    <th>应聘方向</th>
                    <th>学校</th>
                    <th>联系电话</th>
                    <th style="width: 360px">操作</th>
                </thead>
                <tbody>
                	<c:forEach items="${staffs}" var="staff">
                        	<tr>
                            <td>${staff.staffName}</td>
                            
                            	<c:if test="${staff.staffState==1}">
                            		<td>正常</td>	
                            	</c:if>
                            	<c:if test="${staff.staffState==2}">
                            		<td>淘汰</td>	
                            	</c:if>
                            
                            <td>${staff.direction}</td>
                            <td>${staff.school}</td>
                            <td>${staff.tel}</td>
                           
										<td style="width: 360px">
											<span class="basic_details" onclick="putOn2(${staff.staffId})"><a>详情</a>
											</span>
											<span class="basic_edit" onclick="putOn3(${staff.staffId})"><a href="#">编辑</a>
											</span>
											
										</td>
                        </tr>
                        </c:forEach>                 
                </tbody>
            </table>
        </div>
        
        <div align="center" style="margin-top:15px">
共<a class="blue" id="sjzl"></a>条记录&nbsp;&nbsp;当前<a class="blue" id="btn0"></a>页&nbsp;&nbsp;&nbsp;
	<a id="btn0"></a>
	<a  href="#" id="btn1">首页</a>
	<a  href="#" id="btn2">上一页</a>
	<a  href="#" id="btn3">下一页</a>
	<a  href="#" id="btn4">尾页</a> &nbsp;&nbsp;
	
	  转到第<input type="text" id="changePage" size="1" maxlength="4" style=" width:30px; text-align:center; border:1px solid #ccc;"/>页
	  <input type="button" id="btn5" value="跳转"/>
</div>
    </div>
	
</div>

</body>
</html>